﻿
@{
    ViewBag.Title = "商品详情";
    Layout = "~/Views/Shared/_MallLayout.cshtml";
    var img_url = ViewBag.img_url;
    long curUserId = ViewBag.CurUserId;
}
@model token_bazaar_product_dto
<body class="page-view page-viewHz">
    <div class="viewTop ">
        <span class="img fn-left mr20"><img src="@(string.IsNullOrEmpty(Model.merchant_photo)?"/Content/images/my/icon.png":img_url+Model.merchant_photo)" /></span>
        <span class="fn30">@(Model.merchant_name)</span>
        <span class="fn-right col-gray fn26">
            @Model.update_time 发布
        </span>
    </div>
    <div class="view fn26">
        <div class="mb20 mt10">
            价格：<em class="col-gray">￥</em><em class="col-red fn48">@Model.market_price</em> @*<em class="col-gray">红钻</em>*@
        </div>
        <div class="mb30">
            邮费：<em class="col-red">@(Model.delivering == 0 ? "包邮" : "到付")</em>
        </div>
        <div class="col-black fn30 mb20">
            @Model.product_name
        </div>
        <p>
            @Model.prodcut_desc
        </p>
    </div>
    <div class="contentImg lt-mb">
        @foreach (var item in Model.imgs) {
            <img src="@(img_url+item)" />
        }
    </div>
    <div class="pro mb20">
        <div class="content " style=" padding-top:0.5rem">
            <p class="fn26 col-gray">
                拓垦集市温馨提醒您：
            </p>
            <p class="fn26 col-gray" style="text-indent:1rem">
               
                集市上所有商品由拓垦用户自行提供，产品真实性及合法性由发布者负责，该信息包括但不限于商品、服务、价格、质量、包装、产品描述、售后服务等。
                如遇商品质量、虚假信息等争议纠纷，您可以直接与商品发布者协商处理，拓垦集市对该信息不承担任何直接或者间接的法律责任。
            </p>
        </div>
    </div>
    <div class="lt-bottom">
        <a href="#" class="item">
            <i class="icon-share2 product_share " data-title="@Model.product_name" data-desc="@Model.prodcut_desc" data-imgurl="@(img_url + Model.main_img)" data-id="@Model.id"></i><em class="fn28">分享</em>
        </a>
        <div class="right">
            <a href="javascript:toConfirmOrder();" class="ui-btn-buy">
                立即购买
            </a>
        </div>
    </div>
    <script src="~/Scripts/token-common.js"></script>
    <script type="text/javascript">
        function toConfirmOrder() {
           var userId = Number('@curUserId');
           if (userId == 0) {
               var loginResult = isLogin();
               if (!loginResult)
                   return loginResult;
           }
            window.location.href = '/BazaarOrder/ConfirmOrder?id=@Model.id';
        }
        $(".product_share").click(function () {
             var that = $(this);
                var obj = {};
                obj.title = "我在拓垦发布了" +that.attr('data-title');
                obj.desc = that.attr('data-desc');
                obj.img = that.attr('data-imgurl');
                var url = 'http://' + '@Request.Url.Authority' + '/BazaarProduct/Detail?Id=' + that.attr('data-id');
               obj.url = url;
                try {
                    var data = JSON.stringify(obj);
                    if (browser.versions.ios) {
                        window.webkit.messageHandlers.BazaarShare.postMessage(data);
                    } else if (browser.versions.android) {
                        androidfuntion.BazaarShare(data)
                    }
                } catch (e) {
                }
        });

    </script>
</body>

